@import './../app/variables.css';
@import './../app/variablesV2.css';

:root {
  --search-box-font-size: 12px;
  --search-box-line-height: 56px;
  --search-box-selection-background: var(--color-primary-light);
}

.wrapper {
  height: 36px;
}

.autoSuggest {
  display: none;
  background-color: var(--color-white);
  left: 0;
  right: 0;
  position: absolute;
  top: 38px;
  z-index: var(--autosuggest-index);
  border-radius: 3px;
  border-top: none;
  max-height: 353px;
  min-height: 41px;
  box-shadow: var(--box-shadow-search);
}

.show {
  display: block;
}

.placeholder {
  background-color: transparent;
  line-height: var(--search-box-line-height);
  font-size: var(--search-box-font-size);
  color: var(--color-grayscale-medium);
  outline: none;
  border: none;
  position: absolute;
  left: 24px;
  z-index: var(--searchbar-placeholder-index);
  pointer-events: none;
  opacity: 0.5;
  padding: 0 0 0 1px;
  width: calc(100% - 44px);
  text-overflow: ellipsis;
  height: 33px;
}

.noResults {
  color: var(--color-primary-standard);
  font-family: var(--content-font);
  font-size: var(--button-font-size-s);
  padding: 0 16px;
}

.input {
  padding: 1px;
  z-index: var(--searchbar-input-index);
  height: 36px;
  background-color: var(--color-white);
  border: 0.5px solid #a6adbd;
  border-radius: var(--border-radius-standard);

  & input {
    background-color: var(--color-white);
    line-height: var(--search-box-line-height);
    font-size: var(--search-box-font-size);
    color: var(--color-grayscale-medium);
    width: 94%;
    padding: 0px;
    padding-left: 24px;
    border-radius: 3px;
    border: none;
    transition: background-color 300ms linear;
    height: 31px;

    &::selection {
      color: var(--color-white);
      background: var(--search-box-selection-background);
    }

    &::placeholder {
      color: var(--color-grayscale-medium);
      font-weight: 200;
      letter-spacing: 0;
    }

    &:focus {
      outline: none;
      background-color: var(--color-white);
    }
  }

  & span:nth-child(2) {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;

    &::before,
    &::after {
      background-color: var(--color-grayscale-light);
    }
  }

  & .icon {
    width: 15px;
    height: 15px;
    position: absolute;
    top: 12px;
    right: 13px;
    cursor: pointer;
    font-size: 14px;
  }

  & .iconSearch {
    color: var(--color-grayscale-medium);
    width: 20px;
    height: 20px;
    top: 9px;
    font-size: 20px;
  }
}

@media (--medium-viewport) {
  .wrapper {
    margin-right: 0;
  }

  .autoSuggest {
    right: 0;
  }

  .placeholder {
    left: 22px;
  }

  .input {
    & input {
      padding-left: 21px;
    }

    & .icon {
      padding: 0 21px 21px;
    }
  }
}
